]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
[dash] Switch to using StWidget gradients
authorColin Walters <walters@verbum.org>
Thu, 19 Nov 2009 22:04:05 +0000 (17:04 -0500)
committerColin Walters <walters@verbum.org>
Sat, 21 Nov 2009 00:51:46 +0000 (19:51 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=602131

data/theme/gnome-shell.css
js/ui/dash.js

index e161905c074568aaf99f6661f187972820ac8054..16b6f76b0b10bb9e3cdec7529c6a8718e6123814 100644 (file)
@@ -141,8 +141,9 @@ StTooltip {
 
 .section-header {
     border: 1px solid #262626;
-    -shell-gradient-top: #161616;
-    -shell-gradient-bottom: #000000;
+    background-gradient-direction: vertical;
+    background-gradient-start: #161616;
+    background-gradient-end: #000000;
     font-weight: bold;
     font-size: 12px;
 }
index 3398fce9ed3eaf49759075b0020a68c1a6cf6f68..3a2f5e4cb5b3985fbd233944eb273f575890f3cc 100644 (file)
@@ -390,14 +390,6 @@ SectionHeader.prototype = {
         this._innerBox = new St.BoxLayout({ style_class: "section-header-inner" });
         this.actor.set_child(this._innerBox);
 
-        this._backgroundGradient = null;
-        this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
-        this.actor.connect('notify::allocation', Lang.bind(this, function (actor) {
-            if (!this._backgroundGradient)
-                return;
-            this._onStyleChanged();
-        }));
-
         this.backLink = new BackLink();
         this._innerBox.add(this.backLink.actor);
         this.backLink.actor.hide();
@@ -422,33 +414,6 @@ SectionHeader.prototype = {
         }
     },
 
-    _onStyleChanged: function () {
-        if (this._backgroundGradient) {
-            this._backgroundGradient.destroy();
-        }
-        // Manually implement the gradient
-        let themeNode = this.actor.get_theme_node();
-        let gradientTopColor = new Clutter.Color();
-        if (!themeNode.get_color("-shell-gradient-top", false, gradientTopColor))
-            return;
-        let gradientBottomColor = new Clutter.Color();
-        if (!themeNode.get_color("-shell-gradient-bottom", false, gradientBottomColor))
-            return;
-        this._backgroundGradient = Shell.create_vertical_gradient(gradientTopColor,
-                                                                   gradientBottomColor);
-        let box = this.actor.allocation;
-        let contentBox = new Clutter.ActorBox();
-        themeNode.get_content_box(box, contentBox);
-        let width = contentBox.x2 - contentBox.x1;
-        let height = contentBox.y2 - contentBox.y1;
-        this._backgroundGradient.set_size(width, height);
-        // This will set a fixed position, which puts us outside of the normal box layout
-        this._backgroundGradient.set_position(0, 0);
-
-        this._innerBox.add_actor(this._backgroundGradient);
-        this._backgroundGradient.lower_bottom();
-    },
-
     setTitle : function(title) {
         this.text.text = title;
     },